using LocalOverride.Fiddler;
using NUnit.Framework;

namespace LocalOverride.Tests
{
    [TestFixture]
    public class LoggerTests
    {
        [Test]
        public void CanCreateLogger()
        {
            new Logger();
        }

        [Test]
        public void LoggerPublishesEvents()
        {
            ILogger logger = new Logger();

            var testMessageListener = new TestMessageListener();
            logger.NewMessage += testMessageListener.Blah;
            const string message = "Message";
            logger.Log(message);

            Assert.AreEqual(message, testMessageListener.Message);
        }
    }

    public class TestMessageListener
    {
        public void Blah(object sender, NewMessageEventArgs args)
        {
            Message = args.Message;
        }

        public string Message { get; set; }
    }
}